import request from '@/router/axios'

export const login = (data) => {
  return request({
    url: '/rel/webapi/user/webLogin',
    method: 'post',
    data: {
      ...data
    }
  })
}

export const register = (data) => {
  return request({
    url: '/rel/webapi/user/userRegister',
    method: 'post',
    data: {
      ...data
    }
  })
}

export const commitIssueNews = (data) => {
  return request({
    url: '/rel/webapi/content/releaseInformation',
    method: 'post',
    data: {
      ...data
    }
  })
}

export const getHomeInfo = (params) => {
  return request({
    url: '/rel/webapi/content/getIndexInfo',
    method: 'get',
    params: {
      ...params
    }
  })
}

export const getNewsList = (params) => {
  return request({
    url: '/tbs-member/client/member/detail',
    method: 'get',
    params: {
      ...params
    }
  })
}

export const getNewsDtail = (id) => {
  return request({
    url: '/rel/webapi/content/getContentInfo?contentId=' + id,
    method: 'get'
  })
}

export const getNewsCategoryList = (id) => {
  return request({
    url: '/rel/webapi/content/getTypeItemList?typeId=' + id,
    method: 'get'
  })
}

export const getCategoryInfo = (id) => {
  return request({
    url: '/rel/webapi/content/queryTypeAllList?typeId=' + id,
    method: 'get'
  })
}

export const getCategoryNewsList = (data) => {
  return request({
    url: '/rel/webapi/content/queryContentTypeList',
    method: 'post',
    data: {
      ...data
    }
  })
}

export const commitReport = (data) => {
  return request({
    url: '/rel/webapi/content/addComplaint',
    method: 'post',
    data: {
      ...data
    }
  })
}
